<%--
  Created by IntelliJ IDEA.
  User: Administrator
  Date: 2021/11/5
  Time: 16:40
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<html>
<head>
    <title>Title</title>
    <%--    引入my97date的js文件--%>
    <script language="javascript" type="text/javascript" src="My97DatePicker/WdatePicker.js"></script>
</head>
<body>
<form action="studentServlet" method="post" enctype="multipart/form-data">
    <input type="hidden" name="mark" value="updateStudent">
    <input type="hidden" name="sid" value="${student.sid }">
    <input type="hidden" name="oldPhoto" value="${student.photo }">
    姓名: <input type="text" name="sname" value="${student.sname }"> <br>
    <%--    性别回显   使用c标签 if判断--%>

    性别: <input type="radio" name="sex" value="男"
               <c:if test="${student.sex == '男'}">checked</c:if>>男
    <input type="radio" name="sex" value="女"
           <c:if test="${student.sex == '女'}">checked</c:if>>女<br>
    <%--    爱好的回显    抽烟,喝酒
        使用c标签的if判断
        contains  包含   返回结果true和false
     --%>

    爱好: <input type="checkbox" name="hobby" value="抽烟"
               <c:if test="${student.hobby.contains('抽烟')}">checked</c:if>>抽烟
    <input type="checkbox" name="hobby" value="喝酒"
           <c:if test="${student.hobby.contains('喝酒')}">checked</c:if>>喝酒
    <input type="checkbox" name="hobby" value="rap"
           <c:if test="${student.hobby.contains('rap')}">checked</c:if>>rap
    <input type="checkbox" name="hobby" value="烫头"
           <c:if test="${student.hobby.contains('烫头')}">checked</c:if>>烫头 <br>

    生日:<input class="Wdate" type="text" name="sbir"
              value="<fmt:formatDate value="${student.sbir }" pattern="yyyy-MM-dd HH:mm:ss" />"
              onClick="WdatePicker({el:this,dateFmt:'yyyy-MM-dd HH:mm:ss'})">
    <br>
    图像: <input type="file" name="photo" value="">
    <img src="http://localhost:8080/studentpic/${student.photo }" width="100px" alt="">
    <br>
    <input type="submit" value="修改学生">

</form>
</body>
</html>
